import request from "../utils/request";



export function login(LoginForm) {
    return request({
        url: '/user/login',
        method: 'post',
        data:LoginForm
    })
}
//用户管理 
//医生
export function getDoctors(area,buwei) {
    return request({
        url: `doctor/getDoctors/${area}/${buwei}`,
        method: 'get',
    })
}

export async function deleteDoctorById(id) {
    return request({
        url: `doctor/deleteDoctorById/${id}`,
        method: 'delete',
    })
}

export async function editDoctor(doctor) {
    return request({
        url: `doctor/editDoctor`,
        method: 'post',
        data:doctor
    })
}


//患者
export function getUsers() {
    return request({
        url: `user/getUsers`,
        method: 'get',
    })
}

export async function deleteUserById(id) {
    return request({
        url: `user/deleteUserById/${id}`,
        method: 'delete',
    })
}
//编辑患者
export async function editUser(user) {
    return request({
        url: `user/editUser`,
        method: 'post',
        data:user
    })
}
//编辑管理员个人信息
export async function editAdmin(user) {
    return request({
        url: `user/editAdmin`,
        method: 'post',
        data:user
    })
}

//文章管理
export async function publishArticle(article) {
    return request({
        url: `article/AddArticle`,
        method: 'post',
        data:article
    })
}

export async function getAllArticles() {
    return request({
        url: `article/getAllArticles`,
        method: 'get',
    })
}

export async function deleteArticleById(id) {
    return request({
        url: `article/deleteArticleById/${id}`,
        method: 'delete',
    })
}

export async function ModifyArticle(article) {
    return request({
        url: `article/ModifyArticle`,
        method: 'POST',
        data:article
    })
}
//影像管理
export async function getAllImages() {
    return request({
        url: `image/getAllImages`,
        method: 'get',
    })
}

//报告管理
export async function getAllReport() {
    return request({
        url: `report/getAllReport`,
        method: 'get',
    })
}



// export async function deleteArticleById(id) {
//     return request({
//         url: `article/deleteArticleById/${id}`,
//         method: 'delete',
//     })
// }

// export async function ModifyArticle(article) {
//     return request({
//         url: `article/ModifyArticle`,
//         method: 'POST',
//         data:article
//     })
// }

